﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminProductList.ascx.cs" Inherits="smartphone.UserControls.AdminProductList" %>

<div class="adminTable">
    <form id="adminProduct" runat="server">
        <div class="adminTitle">
            <asp:Label ID="LabelInform" runat="server" Text="Quản lí danh sách sản phẩm"></asp:Label>
        </div>

        <asp:GridView ID="GridViewProductList" runat="server" Width="100%" AutoGenerateColumns="False" DataKeyNames="maSanPham" OnRowDeleting="GridViewProductList_RowDeleting">
            <Columns>
                <asp:BoundField DataField="tenSanPham" HeaderText="Tên sản phẩm" SortExpression="tenSanPham" />
                <asp:BoundField DataField="tenHang" HeaderText="Tên hãng" SortExpression="tenHang" />
                <asp:ImageField DataImageUrlField="hinhDaiDien" ItemStyle-CssClass="adminThumbnail" DataImageUrlFormatString="~/ProductImages/{0}" HeaderText="Hình đại diện" ReadOnly="True">
<ItemStyle CssClass="adminThumbnail"></ItemStyle>
                </asp:ImageField>
                <asp:BoundField DataField="soLuong" HeaderText="Số lượng" SortExpression="soLuong" />
                <asp:BoundField DataField="donGia" HeaderText="Đơn giá" SortExpression="donGia" DataFormatString="{0:0,000}" HtmlEncode="false" />
                <asp:BoundField DataField="ngayNhap" HeaderText="Ngày nhập" SortExpression="ngayNhap" dataformatstring="{0:d-M-yyyy}" htmlencode="false" ReadOnly="True" />
                <asp:BoundField DataField="phuKien" HeaderText="Phụ kiên" SortExpression="phuKien" />
                <asp:BoundField DataField="cpu" HeaderText="Cpu" SortExpression="cpu" />
                <asp:BoundField DataField="mayAnh" HeaderText="Máy ảnh" SortExpression="mayAnh" />
                <asp:BoundField DataField="wifi" HeaderText="Wifi" SortExpression="wifi" />
                <asp:BoundField DataField="dinhDangNhac" HeaderText="Định dạng nhạc" SortExpression="dinhDangNhac" />
                <asp:BoundField DataField="camBien" HeaderText="Cảm biến" SortExpression="camBien" />
                <asp:BoundField DataField="dinhDangPhim" HeaderText="Định dạng video" SortExpression="dinhDangPhim" />
                <asp:CheckBoxField DataField="congBo" HeaderText="Công bố" SortExpression="congBo" />
                <asp:HyperLinkField DataNavigateUrlFields="maSanPham" DataNavigateUrlFormatString="~/AdminEditProductPage.aspx?productID={0}" HeaderText="Sửa" Text="Sửa" />
                <asp:TemplateField HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="Xóa" OnClientClick="return confirm('Bạn có chắc muốn xóa sản phẩm này, nên chọn tủy chọn ngừng công bố.');"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

    </form>
</div>